package String;

public class item415 {
    public String addStrings(String num1, String num2) {
        StringBuffer sb = new StringBuffer();
        int temp = 0;
        int first = num1.length()-1;
        int second = num2.length()-1;
        while (first>=0||second>=0||temp!=0)
        {
            if(first>=0)
            {
                temp = temp+num1.charAt(first)-'0';
                first--;
            }
            if(second>=0)
            {
                temp = temp+num2.charAt(second)-'0';
                second--;
            }
            sb.append(temp%10);
            temp = temp/10;

        }
        String res = sb.reverse().toString();

        return res;
    }
}
